import re
match = re.match("[0-9]{1,3}",'12345asdf34ds')
print(type(match))
print(match)
print(match.group())
match = re.match("[0-9]",'5678asdgfasdf34ds')
print(type(match))
print(match)
print(match.group())